
from lib.PowerLed import PowerLed
 
import time
import math 

class PowerLedTest():
 
    def __init__(self):
        super().__init__()
        print("PowerTest init")
        POWER_PIN_LED_RED = 4
        POWER_PIN_LED_GREEN = 2
        POWER_PIN_LED_BLUE =5
        self.led = PowerLed(POWER_PIN_LED_RED,POWER_PIN_LED_GREEN,POWER_PIN_LED_BLUE)
         
  
         # 点亮RGB灯带  
    def set_color(self,r, g, b):  
        self.led.redLedPin.value(r)  
        self.led.greenLedPin.value(g)  
        self.led.blueLedPin.value(b)     
            
            
            
if __name__ == '__main__':
    red = 0 
    green = 0
    blue = 0

    test = PowerLedTest()
    # 主循环  
    while True:  
        test.set_color(red, green, blue)  # 设置RGB颜色为红色  
        time.sleep(1)  # 等待1秒  
#         test.set_color(0, green, blue)  # 设置RGB颜色为绿色  
#         time.sleep(1)  # 等待1秒  
#         test.set_color(0, 0, blue)  # 设置RGB颜色为蓝色  
#         time.sleep(1)  # 等待1秒
         
